SettingsManager

interface SettingsManager

Provides information about the Mobile Payments SDK, such as the SDK version and environment. Also provides access to the payment settings, such as if offline processing is allowed. Additionally, you can display the Square-provided settings screen.

Properties

Link copied to clipboard

The current state of user consent for analytics and performance tracking. This field is changed when consent is updated, either through updateTrackingConsent or through the SDK's built-in consent request (shown when users first visit the payment or settings screen, if no consent was previously provided via API).

Functions

Link copied to clipboard
abstract fun closeSettings(): Boolean

Programmatically closes the settings screen if it is currently being displayed.

Link copied to clipboard

Returns a PaymentSettings, used to determine if offline processing is allowed.

Link copied to clipboard
abstract fun getSdkSettings(): SdkSettings

Returns a SdkSettings, used to determine the SDK version and environment.

Link copied to clipboard
abstract fun isShowingSettings(): Boolean

Returns true if the settings screen is currently being displayed.

Link copied to clipboard
abstract fun showSettings(onResult: (SettingsResult) -> Unit)

Used to display the Mobile Payments SDK settings screen.

Link copied to clipboard
abstract fun updateTrackingConsent(granted: Boolean)

Enables or disables analytics and performance tracking for the Mobile Payments SDK based on user consent. When granted is set to true, the SDK will collect data to monitor metrics and performance.